import { createRouter, createWebHashHistory , createWebHistory } from 'vue-router'
// import 自定义组件名 from 路径
import AppVue from '@/app/app.vue'
import SearchVue from '@/app/components/Search.vue'
import TraceVue from '@/app/components/Trace.vue'
import UserVue from '@/app/components/User.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/app',
      redirect: '/app/search'
    },
    {
      path: '/app/search',
      component: SearchVue,
      meta: {
        keepAlive: true,
      }
    },
    {
      path: '/app/trace',
      component: TraceVue
    },
    {
      path: '/app/user',
      component: UserVue
    },
  ]
})

export default router
